//提示信息
var hint = {
	brains_type: '勇气祝福换装的智力类型',
	n_brains: '适用智力=站街智力+虔诚信念智力',
	n_courage: '勇气祝福等级',
	n_faith: '勇气祝福换装的一绝被动',
	n_weapon: '武器,计算勇气额外加成',
	n_seven: '七宗罪,自动计算三件套属性',
	n_oracle: '圣光天启等级',
	oracle_brains_type: '一觉换装智力类型',
	oracle_brains: '适用智力=站街智力+虔诚信念智力',
	oracle_faith: '一觉换装的一觉被动',
	c_power: '主C进图后力量',
	c_powerb: '主C百分比力量/%',
	c_attack: '主C进图后面板攻击力,物/魔功自动转换为实际攻击力',
	c_attackb: '主C百分比攻击力/%',
	harm_type: '主C攻击类型',
	courage: '勇气祝福奶量',
	oracle: '一觉奶量',
	courage_anthem: '勇气祝福+勇气圣歌奶量',
	courage_oracle: '勇气祝福+一觉的奶量+圣歌效果',
}

//基础数据
var nurse = {
	//奶属性
	brains_type: '站街智力', //站街/适用
	n_brains: 0, //奶智力
	n_courage: 20, //奶勇气
	n_faith: 16, //奶一觉被动
	n_weapon: 0, //奶武器
	n_seven: [0, 0, 0, 0, 0], //七宗罪

	n_oracle: 20, //奶一觉
	oracle_brains_type: '站街智力', //一觉智力类型
	oracle_brains: 0, //一觉智力
	oracle_faith: 16, //一觉时一绝被动

	//主C属性
	c_power: 0, //C力量智力
	c_powerb: 0, //百分比力量
	c_attack: 0, //攻击力
	c_attackb: 0, //百分比攻击力
	harm_type: {
		name: '物理百分比',
		power: '力量',
		powerid: 'power',
		attack: '物攻',
		attackid: 'physical_att'
	}, //伤害类型

};

//勇气祝福等级数据
var courageData = {
	power: [0, 131, 140, 149, 158, 167, 175, 184, 193, 202, 211, 220, 229, 238, 247, 256, 264, 273, 282, 291, 300, 309, 318, 327, 336, 344, 353, 362, 371, 380, 389, 398, 407, 416, 424, 433, 452, 461, 470, 479, 488], //力量奶量
	physical_att: [0, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 50, 51, 52], //物攻奶量
	brains: [0, 134, 144, 154, 164, 174, 184, 193, 203, 213, 223, 233, 243, 253, 262, 272, 282, 292, 302, 312, 322, 331, 341, 351, 361, 371, 381, 390, 400, 410, 420, 430, 440, 449, 459, 469, 479, 489, 499, 508, 518], //智力奶量
	magic_att: [0, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 40], //魔攻奶量
	fixed_att: [0, 34, 35, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 58, 60, 61, 62, 64, 65, 66, 68, 69, 70, 72, 73, 74, 76, 77, 78, 80, 81, 82, 84, 85, 86], //独立
};

//一觉被动等级数据
var faithData = [0, 14, 37, 59, 82, 104, 127, 149, 172, 194, 217, 239, 262, 284, 307, 329, 352, 374, 397, 419, 442, 464, 487, 509, 532, 554, 577, 599, 622, 644, 667];
//一觉力智提升
var oracleData = [0, 42, 55, 71, 88, 106, 126, 147, 169, 193, 218, 244, 273, 302, 332, 364, 397, 431, 468, 505, 545, 584, 625, 668, 712, 757, 804, 853, 902, 953, 1004];
//七宗罪数据
var sevenData = {
	'one': [{
			power: [0.05, 9], //力量奶量
			physical_att: [0.15, 2], //物攻奶量
		}, {
			brains: [0.05, 10], //智力奶量
			magic_att: [0.15, 2], //魔攻奶量
		},
		{
			fixed_att: [0.2, 5], //独立
		},
	],
	'series': {
		power: [0.12, 0], //力量奶量  2
		brains: [0.12, 0], //智力奶量
	}
}
//武器数据
var weaponData = [{},
	//圣耀救赎十字架
	{
		brains: [0, 6], //智力奶量
		physical_att: [0, 18], //物攻奶量
		magic_att: [0, 7], //魔攻奶量
	},
	//荒古十字架魔能解放
	{
		power: [0, 31], //力量奶量
		brains: [0, 42], //智力奶量
		physical_att: [0, 24], //物攻奶量
		magic_att: [0, 10], //魔攻奶量
	},
	//荒古十字架
	{
		power: [0, 23], //力量奶量
		brains: [0, 31], //智力奶量
		physical_att: [0, 16], //物攻奶量
		magic_att: [0, 7], //魔攻奶量
	},
]

//结果
var result = {};
//结果模板
var template = {
	//奶量数据
	power: 0, //力量奶量
	physical_att: 0, //物攻奶量
	brains: 0, //智力奶量
	magic_att: 0, //魔攻奶量
	fixed_att: 0, //独立
}
template = JSON.stringify(template);
$("#result_body tr").each(function() {
	var id = $(this).attr("id");
	result[id] = JSON.parse(template)
})

//百分比提升数据
var perData = {
	power: [0, 0], //力量奶量
	physical_att: [0, 0], //物攻奶量
	brains: [0, 0], //智力奶量
	magic_att: [0, 0], //魔攻奶量
	fixed_att: [0, 0], //独立
}

/**
 * Highcharts -------------------------------
 */

var chart = Highcharts.chart('highcharts', {
	chart: {
		type: 'bar'
	},
	title: {
		text: '提升表'
	},
	xAxis: {
		categories: ['基础', '勇气', '勇+觉']
	},
	yAxis: {
		allowDecimals: false,
		min: 0,
		title: {
			text: ''
		}
	},
	tooltip: {
		formatter: function() {
			return '<b>' + this.x + '</b><br/>' +
				this.series.name + ': ' + this.y + '<br/>';
		}
	},
	legend: {
		reversed: true
	},
	plotOptions: {
		column: {
			stacking: 'normal'
		}
	},
	series: [{
		name: nurse.harm_type.attack,
		data: [0, 0, 0]
	}, {
		name: nurse.harm_type.power,
		data: [0, 0, 0]

	}],
	exporting: {
		enabled: false
	}, //隐藏导出图片
	credits: {
		enabled: false
	} //隐藏highcharts的站点标志
});